Matthew 6:1
"Beware of practicing your righteousness before other people in order to be seen by them, for then you will have no reward from your Father who is in heaven.
Introduction
This passage continues to address our relationship to God and to others around us as the passage in 5:43–48 had. Here the focus is on whom we are trying to please—whether God, others, or ourselves.
If we do good to make others think more highly of us, we please ourselves. We ought rather to please God.
Just as verses 5:43–48 showed we love others without reference to how they first treat us, the current reading shows we seek to please God without regard to whether others see us doing so. The point is to serve God directly by serving others.
Ananias & Sapphira
The idea of doing good in order to be seen doing good brings to mind the account of Ananias and Sapphira in Acts 5.
Acts 4:34–35, 5:1–5
There was not a needy person among them, for as many as were owners of lands or houses sold them and brought the proceeds of what was sold and laid it at the apostles' feet, and it would be distributed to each as any had need....
But a man named Ananias, with his wife Sapphira, sold a piece of property, and with his wife's knowledge he kept back for himself some of the proceeds and brought only a part of it and laid it at the apostles' feet. But Peter said, "Ananias, why has Satan filled your heart to lie to the Holy Spirit and to keep back for yourself part of the proceeds of the land? While it remained unsold, did it not remain your own? And after it was sold, was it not at your disposal? Why is it that you have contrived this deed in your heart? You have not lied to man but to God." When Ananias heard these words, he fell down and breathed his last. And great fear came upon all who heard of it.
Many foreign-born Jews who were in Jerusalem for Pentecost obeyed the gospel in Acts 2. Such Christians decided to move their permanent residence to Jerusalem so they could continue with the new and growing congregation of the Lord. This meant they could sell their foreign holdings and donate any profit to the Lord.
While they were not required to give 100% of the profit, Ananias and Sapphira gave the church the impression they had given 100%. They wanted the brethren to see them giving a large sum of money and think they were as charitable and selfless as the others in their situation who were doing so. This is why Peter's rebuke included, "You have not lied to men."
Their death was at God's hands, not Peter's, because the contribution in fact belongs to God, not men. This is just like Matthew 6:1–4 in that we must recognize the good we do is for God, not men.